#ifndef CARAPACE_HPP_INCLUDED
#define CARAPACE_HPP_INCLUDED

#define LARGSPRITECARAP 16
#define HAUTSPRITECARAP 16
#define GAUCHE 1
#define DROITE 2
#define HAUT 3
#define BAS 4

class Carapace{

    public:

    Carapace(float x, float y,sf::Image &image);
    ~Carapace();
    void setPosition(float x, float y);
    void moveCarap();

	void rebond(int dir);

    void upVitesse();
    void downVitesse();

    void upAngle();
    void downAngle();
    void setAngle(double angle);
    void setVitesse(int vitesse);

	float getVitesseX();
	float getVitesseY();
	float getVitesse();
	float getAngle();

    //void launchAnim();

    sf::Sprite &getSprite();
    sf::FloatRect getPositionObj();

    private:

    double calcVitesseX();
    double calcVitesseY();
    double calcAngle();

    sf::Sprite sprite;
	sf::IntRect tabPosition[4];
	sf::Vector2f initPos;

	double vitesse;
	double angle;
    double vx;
    double vy;
    //time_t t0;
    sf::Clock timeMove;

	int numSpriteCarap;

	//int tempsPrecedent;
	sf::Clock timeSprite;
};

#endif // CARAPACE_HPP_INCLUDED
